using System;
using ExampleMvcApplication.Models.Response;

namespace ExampleMvcApplication.Models.Request
{
    public class ChangePasswordRequest : MasterModel
    {
        public string CurrentPassword { get; set; }
        public string NewPassword { get; set; }
        public string ConfirmPassword { get; set; }

        public int MinPasswordLength { get; set; }

        public ChangePasswordRequest(string userName, int minPasswordLength) : base(true, userName)
        {
            MinPasswordLength = minPasswordLength;
        }

        public ChangePasswordRequest() : base(false, null)
        {
        }
    }

    public class RegisterRequest : MasterModel
    {
        public string UserName { get; set; }
        public string Email { get; set; }
        public string Password { get; set; }
        public string ConfirmPassword { get; set; }
        public string ReturnUrl { get; set; }

        public int MinPasswordLength { get; set; }

        public RegisterRequest() : this(null, null, null, null, 0, null)
        {
        }

        private RegisterRequest(string userName, string email, string password, string confirmPassword, int minPasswordLength, string returnUrl): base(false, null)
        {
            UserName = userName;
            Email = email;
            Password = password;
            ConfirmPassword = confirmPassword;
            MinPasswordLength = minPasswordLength;
            ReturnUrl = returnUrl;
        }

        public RegisterRequest(int minPasswordLength, string returnUrl) : this(null, null, null, null, minPasswordLength, returnUrl)
        {
        }
    }

    public class LogOnRequest : MasterModel
    {
        public LogOnRequest(string userName, string password, bool rememberMe, string returnUrl) : base(false, null)
        {
            UserName = userName;
            Password = password;
            RememberMe = rememberMe;
            ReturnUrl = returnUrl;
        }

        public LogOnRequest() : this(null, null, false, null)
        {
        }

        public LogOnRequest(string returnUrl) : this(null, null, false, returnUrl)
        {
        }

        public string UserName { get; set; }
        public string Password { get; set; }
        public bool RememberMe { get; set; }
        public string ReturnUrl { get; set; }
    }
}